﻿using BLToolkit.DataAccess;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using BLToolkit.Mapping;

namespace PlatForm.DataLayer
{
    
    [TableName("Picking")]
    public class Picking : Devsoft.DB.Models.Flat.Model<Picking>
    {
        [PrimaryKey, Identity]
        public int PIK_No { get; set; }

        public string ST_No { get; set; }

        public string SUPPL_No { get; set; }

        [MapIgnore]
        public string SUPPL_Name { get; set; }

        public string ORD_No { get; set; }

        [MapIgnore]
        public float ORD_QTY { get; set; }

        public string ART_No { get; set; }

        [MapIgnore]
        public string ART_Name { get; set; }

        public float DELI_QTY { get; set; }

        public int Package { get; set; }
        
        [MapIgnore]
        public float NaturalLoss { get; set; }

        [MapIgnore]
        public float ProcessLoss { get; set; }

        public float DifferKg { get; set; }

        public float DifferPc { get; set; }

        public bool Status { get; set; }

        public DateTime PickDate { get; set; }
        
        [Association(ThisKey = "SUPPL_No", OtherKey = "SUPPL_No", CanBeNull = false)] public Supplier Supplier;

        [Association(ThisKey = "ORD_No", OtherKey = "ORD_No", CanBeNull = false)] public Order Order;

        [Association(ThisKey = "ART_No", OtherKey = "ART_No", CanBeNull = false)] public Article Article;

        [Association(ThisKey = "ST_No", OtherKey = "ST_No", CanBeNull = false)] public Store Store;
    }

    public class PickingGrid : Devsoft.DB.Models.Flat.Model<Picking>
    {
        public string ORD_No { get; set; }

        public string ART_Name { get; set; }

        public string ST_No { get; set; }

        public float DELI_QTY { get; set; }
    }
}